package de.gee.erep.server.xml;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;

import javax.xml.stream.XMLStreamException;

import de.gee.erep.shared.entities.Country;

public class Main {
	public static void main(String[] args) {
		ErepParser<Country> r = new CountryParser(
				"war/Ressources/temp/countries.xml");
		try {
			long start = System.currentTimeMillis();
			r.parse();
			List<Country> result = r.getResult();
			long erg = (System.currentTimeMillis() - start);
			long start1 = System.currentTimeMillis();
			r.parseUpdate();
			List<Country> result1 = r.getResult();
			long erg1 = (System.currentTimeMillis() - start1);
			System.out.println("from File: " + erg + "ms");
			System.out.println("from Stream: " + erg1 + "ms");
		} catch (XMLStreamException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}